-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix(sdk-crashes): Ignore SentrySwizzleWrapper false positives (#105625) #105705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix(sdk-crashes): Ignore SentrySwizzleWrapper false positives (#105625) #105705
Conversation
|
@philipphofmann I’ve opened this PR and would appreciate a review when you have a chance. Thanks! |
philipphofmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for tackling this @calm329. I added a few comments.
tests/sentry/utils/sdk_crashes/test_sdk_crash_detection_cocoa.py
Outdated
Show resolved
Hide resolved
|
@philipphofmann I've fixed according to your feedback, could you review it again? |
philipphofmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for including the feedback. We're not far away from an approval, @calm329 💯
|
@calm329, I went ahead and addressed https://github.com/getsentry/sentry/pull/105705/changes#r2682659766 with a few commits. Otherwise, we most likely would go back and forth a few times. I hope that's OK for you. When the tests are green, I will give this a final pass and approve. |
Fixes #105625
Summary
The SDK crash detection was incorrectly reporting crashes as SDK crashes when
SentrySwizzleWrapperwas the only SDK frame in the stacktrace. These are false positives becauseSentrySwizzleWrapperis an instrumentation frame that intercepts UI events but doesn't cause crashes itself.This PR adds a new conditional SDK frame detection mechanism that only ignores
SentrySwizzleWrapperwhen there are no other SDK frames above it (closer to the crash origin).Changes
sdk_crash_ignore_when_only_sdk_frame_matchersfield toSDKCrashDetectionConfigis_sdk_crash()inSDKCrashDetectorto handle conditional SDK framesSentrySwizzleWrapperpattern to Cocoa SDK configurationCocoaSDKSwizzleWrapperTestMixinwith 3 test cases:How it works
When iterating through frames (youngest to oldest):
True(SDK crash)False(not SDK crash, since any SDK frames above would have triggered step 1)FalseLegal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=148254234